home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BorderStyle = 3 'Fixed Dialog
- Caption = "Wave VBX Start/End Sample"
- ClientHeight = 3135
- ClientLeft = 1650
- ClientTop = 1920
- ClientWidth = 4095
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 3540
- Left = 1590
- LinkTopic = "Form1"
- ScaleHeight = 3135
- ScaleWidth = 4095
- Top = 1575
- Width = 4215
- Begin VB.Timer Timer1
- Interval = 50
- Left = 2880
- Top = 0
- End
- Begin VB.TextBox txtPosition
- Appearance = 0 'Flat
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 9
- Top = 1200
- Width = 3615
- End
- Begin VB.TextBox txtEnd
- Appearance = 0 'Flat
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 2160
- TabIndex = 7
- Top = 1800
- Width = 1695
- End
- Begin VB.TextBox txtStart
- Appearance = 0 'Flat
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 5
- Top = 1800
- Width = 1695
- End
- Begin VB.TextBox txtFilename
- Appearance = 0 'Flat
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 2
- Text = "C:\WINDOWS\RINGOUT.WAV"
- Top = 480
- Width = 3615
- End
- Begin VB.CommandButton btnStop
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Stop"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2160
- TabIndex = 1
- Top = 2520
- Width = 1695
- End
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 2520
- Width = 1695
- End
- Begin WaveLib.Wave Wave1
- Left = 3360
- Top = 0
- _version = 65537
- _extentx = 847
- _extenty = 847
- _stockprops = 64
- exclusive = 0 'False
- filename = ""
- filelength = 0
- loop = 0 'False
- playend = -1
- playstart = -1
- End
- Begin VB.Label Label4
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "Position:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 960
- Width = 1215
- End
- Begin VB.Label Label3
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "End:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 2160
- TabIndex = 6
- Top = 1560
- Width = 1215
- End
- Begin VB.Label Label2
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "Start:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 1560
- Width = 1215
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "Filename:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 240
- TabIndex = 3
- Top = 240
- Width = 1935
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim fChanged As Integer ' flag: has filename changed?
- Private Sub btnPlay_Click()
- ' make sure the filename is up to date
- SetFilename
- ' check for start field
- If Trim(txtStart) <> "" Then
- Wave1.PlayStart = Val(txtStart)
- Else
- Wave1.PlayStart = -1
- End If
- ' check for end field
- If Trim(txtEnd) <> "" Then
- Wave1.PlayEnd = Val(txtEnd)
- Else
- Wave1.PlayEnd = -1
- End If
- ' play the file
- Wave1.Action = 1
- EnableButtons
- End Sub
- Private Sub btnStop_Click()
- ' stop playing
- Wave1.Action = 4
- ' update buttons
- EnableButtons
- End Sub
- Private Sub EnableButtons()
- Select Case Wave1.Status
- Case 1: ' playing
- btnStop.Enabled = True
- Case 2: ' paused
- btnStop.Enabled = True
- Case 4: ' stopped
- btnStop.Enabled = False
- End Select
- End Sub
- Private Sub Form_Load()
- fChanged = True
- EnableButtons
- End Sub
- Private Sub SetFilename()
- ' if the filename has changed, tell Wave VBX
- If fChanged Then
- ' changed no more
- fChanged = False
- Wave1.filename = txtFilename
- End If
- End Sub
- Private Sub Timer1_Timer()
- If Wave1.Position = -1 Then
- txtPosition = ""
- Else
- txtPosition = Format(Wave1.Position / 1000, "0.000") & " seconds"
- End If
- End Sub
- Private Sub txtFilename_Change()
- fChanged = True
- End Sub
- Private Sub Wave1_PlayDone()
- EnableButtons
- End Sub
-